<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <?php include_once MvcReg::$_moduleName . '/views/layout/head.php'; ?>
    <style>.col-md-2, .col-md-3{padding:0}</style>
</head>

<body>
<?php include_once MvcReg::$_moduleName . '/views/layout/woody-prompt.php'; ?>
<?php include_once MvcReg::$_moduleName . '/views/layout/header.php'; ?>
<div id="main">
    <div class="container-fluid">
        <div class="row">
            <div class="col-md-2">
                <?php include_once MvcReg::$_moduleName . '/views/layout/left_menu.php'; ?>
            </div>
            <div class="col-md-10">
                <div class="right-content">
                    <h3>
                        <ol class="breadcrumb">
                            <li>
                                <a href="?md=manage&cl=store&at=storelist">
                                    <i class="fa fa-dashboard">门店列表</a>
                            <li class="active">绑定</li>
                            </li></ol>
                    </h3>
                    <br>
                    <form class="form-horizontal" action="<?php echo $url?>" method="post" autocomplete="off">
                        <input type="hidden" name="store_id"  value="<?php echo $row['id'] ?>">
                        <div class="row">
                            <div class="col-sm-12">
                                <dl class="dl-horizontal">
                                    <div class="form-group">
                                        <label for="addtime" class="col-md-2 control-label"> 门店编号：</label>
                                        <div class="col-md-10">
                                            <label class="control-label"> <?php echo $shop_id ?></label>
                                        </div>
                                    </div>
                                    <div class="form-group">
                                        <label for="elm" class="col-md-2 control-label">
                                            饿了么门店编号：
                                        </label>
                                        <div class="col-md-3">
                                            <input type="text" id="elm" name="elm" value="" class="form-control " placeholder=""/>
                                        </div>
                                    </div>

                                </dl>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="stacode" class="col-md-2 control-label">
                            </label>
                            <div class="col-md-4">
                                <button type="button" id="sub"  class="btn btn-success">保存</button>
                            </div>
                            <span class="col-md-6"></span>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $("#sub").click(function () {
        var elm = $("#elm").val();
        var $page = '<?php echo $page?>';
        var $shop_id = '<?php echo $shop_id?>';
        if(!elm || $.trim(elm) == ''){
            alert("饿了么店铺编号不可为空");
            return false;
        }
        var url = "?md=service&cl=ELM&at=updateStore_temp";
        var jump = '?md=manage&cl=store&at=storelist&page='+$page;
        $.ajax({
            url:url,
            dataType:"json",
            data:{"shop_id":$shop_id,"elm_shop_id":elm},
            type:"post",
            success:function (d) {
                if(d.status == 200){
                    alert(d.msg);
                    window.location.href = jump;
                }else{
                    alert(d.msg)
                }
            }
        })

    });


</script>

<?php include_once MvcReg::$_moduleName . '/views/layout/footer.php'; ?>
</body>
</html>

